package cn.ibizlab.util.adapter.security;

import net.ibizsys.central.cloud.core.IServiceHub;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class DefaultServiceHubSecuritySetting {

    @Value("${ibiz.auth.excludesPattern:}")
    private String[] excludesPattens;
    @Autowired
    IServiceHub iServiceHub;

    @PostConstruct
    protected void postConstruct() {
        for (String pattern : excludesPattens) {
            iServiceHub.registerIgnoreAuthPattern(pattern);
        }
    }
}
